<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app"></div>
  <!-- 1.引入依赖 -->
  <script src="../react/react.development.js"></script>
  <script src="../react/react-dom.development.js"></script>
  <script src="../react/babel.min.js"></script>
  <!-- 2.开始开发 -->
  <script type="text/babel">
    class App extends React.Component{
      constructor() {
        super()
        
        this.state = {
          // 1.可以显示的数据
          name: 'jane',
          age: 18,
          movies: ['abc', 'cba', 'nba'],

          // 2.在{}中不能显示(忽略)
          price: null, // null
          money: undefined,// undefined
          flag: true,// Boolean

          // 3.对象不能作为jsx的子类
          info: {name: 'ming', age: 18}
        }
      }

      render() {
        return (
          <div>
            <div>{this.state.name}</div>
            <div>{this.state.age}</div>
            <div>{this.state.movies}</div>
            {/* 不显示 */}
            <div>{String(this.state.price)}</div>
            <div>{this.state.money + ''}</div>
            <div>{this.state.flag.toString()}</div>

            <div>{this.state.flag ? '你好啊': null}</div>
            
          </div>
        )
      }
    }
    ReactDOM.render(<App/>, document.getElementById('app'))
  </script>
</body>

</html>